package com.veterinaria.actions;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;
import com.veterinaria.bean.CreditoBean;
import com.veterinaria.services.CreditoImplements;

@ParentPackage(value="ProyVeterinaria")
public class CreditoAction extends ActionSupport{
	private static final long serialVersionUID = 1L;
	private CreditoBean creditobean = new CreditoBean();
	private CreditoImplements creditoi = new CreditoImplements();
	
	@Action( value="ARegresar",results={@Result(name="success",location="T_listaCliente",type="tiles")})
	public String regresar() throws Exception{
		return SUCCESS;
	}
	
	@Action( value="AGuardarCredito",results={@Result(name="success",location="T_listaCliente",type="tiles")})
	public String guardarCredito() throws Exception{
		creditoi.grabarCredito(creditobean);	
		return SUCCESS;
	}
	
	public CreditoBean getCreditobean() {
		return creditobean;
	}
	public void setCreditobean(CreditoBean creditobean) {
		this.creditobean = creditobean;
	}
	public CreditoImplements getCreditoi() {
		return creditoi;
	}
	public void setCreditoi(CreditoImplements creditoi) {
		this.creditoi = creditoi;
	}
	
	
}
